<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
  <style>
    .box {
      display: grid;
      grid-template-columns: repeat(3, 100px);
      grid-template-rows: repeat(3, 100px);

      /* grid-template-areas属性用于定义区域。 */
      /* grid-template-areas: 'tl tc tr''cl cc cr''bl bc br'; */
      /* 多个单元格合并成一个区域的写法如下。 */
      /* grid-template-areas: 'a a a''b b b''c c c'; */
      /* 如果某些区域不需要利用，则使用"点"（.）表示。*/
      grid-template-areas: 'a . c''d . f''g . i';
    }

    .box .item {
      background-color: #ccc;
    }
  </style>
</head>

<body>
  <div class="box">
    <div class="item">1</div>
    <div class="item">2</div>
    <div class="item">3</div>
    <div class="item">4</div>
    <div class="item">5</div>
    <div class="item">6</div>
    <div class="item">7</div>
    <div class="item">8</div>
    <div class="item">9</div>
  </div>
</body>

</html>